//封装请求函数
import base from './base.js'

export default (url, data = {}, method = 'GET') => {
	return new Promise((resolve, reject) => {
		wx.request({
			url: base.host + url,	//小程序
			// url,	//h5
			data,
			method,
			success: (res) => {
				resolve(res.data)
			},
			fail: (err) => {
				reject(err)
			}
		})
	})
}